using System;
using System.Data;
using System.Drawing;
//
/// <summary>
/// Son enums que reperesentan valores de tablas (estos registros tienen q tener bolnoborrable = 1.Eje tipospago Gescan)
/// </summary>
public class clsVariablesGescan
{
	public enum e_TiposPago { Caja = 1, TicketEfectivo = 2, FtaEfectivo = 3, FtaCaja = 4 };
	public enum e_TiposRetiradas { Cannabis = 1, Hachis = 2, Materiales = 3, Tinturas = 4, Esquejes = 5 };
}
//
//
public class clsVariables
{
	public enum eTipoShowForm { Show, ShowDialog, Mdi };
	#region RetCamposDescripciones
	private static System.Collections.Generic.Dictionary<string, DataRow> p_dicCamposDescripciones;
	/// <summary>
	/// Recupera  la tabla campos y devuelve la row
	/// </summary>
	/// <param name="strCampo"></param>
	/// <param name="TipoDevolucion"></param>
	/// <returns></returns>
	public static DataRow RetCamposRow(string strCampo)
	{
		string strClaveDic = strCampo.ToLower();
		//get
		//{
		if (p_dicCamposDescripciones == null)
		{
			DataTable dt = clsBBDD.DtObtener("SELECT * FROM Campos", clsVariables.e_TipoOrigen.Sistema, false);
			p_dicCamposDescripciones = new System.Collections.Generic.Dictionary<string, DataRow>();
			foreach (DataRow Dr in dt.Rows)
			{ p_dicCamposDescripciones.Add(Dr["campo"].ToString().ToLower(), Dr); }
		}
		if (p_dicCamposDescripciones.ContainsKey(strClaveDic))
		{ return p_dicCamposDescripciones[strClaveDic]; }
		else { return null; }
		//}
	}
	//
	/// <summary>
	/// Recupera  la tabla campos y devuelve la descripción
	/// </summary>
	/// <param name="strCampo"></param>
	/// <returns></returns>
	public static string RetCamposDescripcion(string strCampo)
	{
		DataRow Dr = RetCamposRow(strCampo);
		if (Dr != null) { return Dr["Descripcion"].ToString(); }
		else { return System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(strCampo); }
	}
	#endregion
	//

	public static frmPrincipalBase frm_Principal;
	public const string str_NombreAplicacion = "GesCan";
    public const string str_DllControlSerial = "C:\\WINDOWS\\Print.Core2.dll"; //OJO en Win7 pq. no hay permisos... hay q ejecutar como administrador
    //public const string str_DllControlSerial = "C:\\Drivers\\Print\\Print.Core2.dll"; 
	public static string str_Version = Utiles.Aplicacion.ObtenerVersionPublicacion();
	public static string str_Prefijo = string.Empty;
	public static string str_NombreBBDDCliente = string.Empty;
	public static string str_NombreBBDDSistema = string.Empty;   
	public static bool bol_Pruebas = false; //Pruebas (flag desarrollador)
    
#region Rutas
	private static string p_PathBackupsBBDD; public static string str_PathBackupsBBDD { get { return p_PathBackupsBBDD; } }
	private static string p_FicheroLog; public static string str_FicheroLog { get { return p_FicheroLog; } }
	private static string p_PathLogs; public static string str_PathLogs { get { return p_PathLogs; } }
	private static string p_PathAdjuntos; public static string str_PathAdjuntos { get { return p_PathAdjuntos; } }
	//
   private static string p_PathBase;
   public static string str_PathBase
	{
		get { return p_PathBase;}
		set 
		{
			p_PathBase = value;
			p_PathAdjuntos = p_PathBase + @"\Adjuntos\";
			if (!System.IO.Directory.Exists(p_PathAdjuntos)) { System.IO.Directory.CreateDirectory(p_PathAdjuntos); } //Crear?
			p_PathLogs = p_PathBase + @"\Logs\";
			if (!System.IO.Directory.Exists(p_PathLogs)) { System.IO.Directory.CreateDirectory(p_PathLogs); } //Crear?
			p_PathBackupsBBDD = p_PathBase + @"\BackupsBBDD\";
			if (!System.IO.Directory.Exists(p_PathBackupsBBDD)) { System.IO.Directory.CreateDirectory(p_PathBackupsBBDD); } //Crear?
			//
			p_FicheroLog = String.Format(@"{0}{1}Log_{2:yyyyMMdd}.txt", p_PathLogs, str_NombreAplicacion, DateTime.Now); //Log del día
		}
	}
#endregion	
	public static eProviderNombre e_ProviderNombreAplicacion;
	public static string str_ProviderNombreAplicacion;
	//Info del user
	//Public Shared Factory As DbProviderFactory 'Esta en clsBBDD
	//
	public enum e_TipoOrigen
	{
		Cliente,
		Sistema
	}
	//
	public enum eProviderNombre //Origenes posibles
	{
		Ninguno,
		Odbc,
		OleDb,
		OracleClient,
		SqlClient,
		SqlServerCe,
		SqlServerCe35,
		OracleDataAccessClient,
		MySqlClient
	}
	//
	#region Cadena Conexión
	public static System.Collections.Generic.Dictionary<e_TipoOrigen, System.Configuration.ConnectionStringSettings> d_Cc;
	public static System.Configuration.ConnectionStringSettings e_Cc(e_TipoOrigen TipoOrigen)
	{
		return d_Cc[TipoOrigen];
	}
	public static string e_CcToString(e_TipoOrigen TipoOrigen)
	{
		return d_Cc[TipoOrigen].ConnectionString;
	}
	#endregion
	//'
	public class Colores
	{
		//------Colores
		//Barra
		public static Color UltraToolbarsManagerBackColor = Color.LightGreen;
		public static Color UltraToolbarsManagerBackColor2 = Color.LightGreen;

		public static Infragistics.Win.GradientStyle UltraToolbarsManagerGradientStyle = Infragistics.Win.GradientStyle.GlassLeft50;
		//Grid
		//Fondo grid
		//.LightSteelBlue
		public static Color UltraGridBackColor = Color.LightGreen;
		public static Color UltraGridBackColor2 = Color.SlateGray;
		public static Infragistics.Win.GradientStyle UltraGridBackGradientStyle = Infragistics.Win.GradientStyle.Elliptical;
		//GroupByBox
		public static Color UltraGridGroupByBoxBackColor = Color.SlateGray;
		public static Color UltraGridGroupByBoxBackColor2 = Color.LightGreen;
		public static Infragistics.Win.UIElementBorderStyle UltraGridGroupByBoxBorderStyle = Infragistics.Win.UIElementBorderStyle.Default;
		public static Color UltraGridGroupByBoxPromptBackColor = Color.Transparent;
		public static Color UltraGridGroupByBoxPromptBackColor2 = Color.Transparent;
		public static Infragistics.Win.GradientStyle UltraGridPromptAppearanceBackGradientStyle = Infragistics.Win.GradientStyle.Elliptical;
		public static Color UltraGridGroupByBoxPromptForeColor = Color.White;
		public static Infragistics.Win.GradientStyle UltraGridGroupByBoxBackGradientStyle = Infragistics.Win.GradientStyle.None;
		//Rows del GroupByBox
		public static Color UltraGridGroupByRowAppearanceBackColor = Color.SlateGray;
		public static Color UltraGridGroupByRowAppearanceBackColor2 = Color.LightGreen;
		public static Infragistics.Win.GradientStyle UltraGridGroupByRowAppearanceBackGradientStyle = Infragistics.Win.GradientStyle.Elliptical;
		//Rows del GroupByBox Activa
		public static Color UltraGridSelectedRowAppearanceBackColor = Color.SlateGray;
		public static Color UltraGridSelectedRowAppearanceBackColor2 = Color.LightGreen;
		public static Infragistics.Win.GradientStyle UltraGridSelectedRowAppearanceBackGradientStyle = Infragistics.Win.GradientStyle.Elliptical;
		//Cabecera grid
		//Color.Khaki
		public static Color UltraGridHeaderBackColor = Color.LightGreen;
		//Color.Khaki
		public static Color UltraGridHeaderBackColor2 = Color.LightGreen;
		public static Infragistics.Win.GradientStyle UltraGridHeaderBackGradientStyle = Infragistics.Win.GradientStyle.None;
		//Color.Khaki
		public static Color UltraGridGroupByColumnHeaderBackColor = Color.LightGreen;
		//Color.Khaki
		public static Color UltraGridGroupByColumnHeaderBackColor2 = Color.LightGreen;
		public static Infragistics.Win.GradientStyle UltraGridGroupByColumnHeaderBackGradientStyle = Infragistics.Win.GradientStyle.None;
		//Row y celda activa
		//.Lavender
		public static Color UltraGridActiveRowBackColor = Color.LightSteelBlue;
		public static Color UltraGridActiveRowForeColor = Color.Black;
		//.Lavender
		public static Color UltraGridActiveCellBackColor = Color.White;

		public static Color UltraGridActiveCellForeColor = Color.Black;
		//TabbedMDIManager
		//Appearance
		public static Color UltraTabMDIManagerBackColor = Color.Gainsboro;
		public static Color UltraTabMDIManagerBackColor2 = Color.Transparent;
		public static Color UltraTabMDIManagerBorderColor = Color.Transparent;
		public static Color UltraTabMDIManagerBorderColor2 = Color.Transparent;
		public static Infragistics.Win.GradientStyle UltraTabMDIManagerBackGradientStyle = Infragistics.Win.GradientStyle.Default;
		//Color cruz cerrar
		public static Color UltraTabMDIManagerForeColor = Color.Black;
		//Tabs no activas (tab Settings, Tab Apperance)
		public static Color UltraTabMDIManagerTabBackColor = Color.Gray;
		public static Color UltraTabMDIManagerTabBackColor2 = Color.Transparent;
		public static Color UltraTabMDIManagerTabBorderColor = Color.Transparent;
		public static Color UltraTabMDIManagerTabBorderColor2 = Color.Transparent;
		public static Infragistics.Win.GradientStyle UltraTabMDIManagerTabBackGradientStyle = Infragistics.Win.GradientStyle.Default;
		public static Color UltraTabMDIManagerTabForeColor = Color.White;
		//TabActiva (tab Settings, Active Tab Apperance)
		public static Color UltraTabMDIManagerTabActivaBackColor = Color.LightGreen;
		public static Color UltraTabMDIManagerTabActivaBackColor2 = Color.Transparent;
		public static Color UltraTabMDIManagerTabActivaBorderColor = Color.Transparent;
		public static Color UltraTabMDIManagerTabActivaBorderColor2 = Color.Transparent;
		public static Infragistics.Win.GradientStyle UltraTabMDIManagerTabActivaBackGradientStyle = Infragistics.Win.GradientStyle.Default;

		public static Color UltraTabMDIManagerTabActivaForeColor = Color.Black;
		//TabControl
		public static Color UltraTabHeaderAreaBackColor = Color.Gainsboro;
		public static Color UltraTabHeaderAreaBackColor2 = Color.Transparent;
		public static Color UltraTabHeaderAreaBorderColor = Color.Transparent;
		public static Color UltraTabHeaderAreaBorderColor2 = Color.Transparent;
		public static Infragistics.Win.GradientStyle UltraTabHeaderAreaBackGradientStyle = Infragistics.Win.GradientStyle.Default;
		//Color cruz cerrar
		public static Color UltraTabHeaderAreaForeColor = Color.Black;
		//Tabs no activas (tab Settings, Tab Apperance)
		public static Color UltraTabBackColor = Color.Gray;
		public static Color UltraTabBackColor2 = Color.Transparent;
		public static Color UltraTabBorderColor = Color.Transparent;
		public static Color UltraTabBorderColor2 = Color.Transparent;
		public static Infragistics.Win.GradientStyle UltraTabBackGradientStyle = Infragistics.Win.GradientStyle.Default;
		public static Color UltraTabForeColor = Color.White;
		//TabActiva (tab Settings, Active Tab Apperance)
		public static Color UltraTabActivaBackColor = Color.LightGreen;
		public static Color UltraTabActivaBackColor2 = Color.Transparent;
		public static Color UltraTabActivaBorderColor = Color.Transparent;
		public static Color UltraTabActivaBorderColor2 = Color.Transparent;
		public static Infragistics.Win.GradientStyle UltraTabActivaBackGradientStyle = Infragistics.Win.GradientStyle.Default;
		public static Color UltraTabActivaForeColor = Color.Black;
		//---------
	}
	//'
	public class UsuarioActualInfo
	{

		public static int intIdUsuario;
		public static int intGrupoUsuario;
		public static string strGrupoUsuario;
		public static string strIdentificadorUsuario;
		public static string strNombreUsuario;
		public static string strMailUsuario;
	}
	//'
}


